<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
  <meta name="description" content="API docs for the StorageService class from the nim_core_v2 library, for the Dart programming language.">
  <title>StorageService class - nim_core_v2 library - Dart API</title>


  
  <link rel="preconnect" href="https://fonts.gstatic.com">
  <link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" rel="stylesheet">
  
  <link rel="stylesheet" href="../static-assets/github.css?v1">
  <link rel="stylesheet" href="../static-assets/styles.css?v1">
  <link rel="icon" href="../static-assets/favicon.png?v1">
  
</head>

<body data-base-href="../" data-using-base-href="false" class="light-theme">
<div id="overlay-under-drawer"></div>
<header id="title">
  <span id="sidenav-left-toggle" class="material-symbols-outlined" role="button" tabindex="0">menu</span>
  <ol class="breadcrumbs gt-separated dark hidden-xs">
    <li><a href="../index.html">nim_core_v2</a></li>
    <li><a href="../nim_core_v2/nim_core_v2-library.html">nim_core.dart</a></li>
    <li class="self-crumb">StorageService class</li>
  </ol>
  <div class="self-name">StorageService</div>
  <form class="search navbar-right" role="search">
    <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
  <div class="toggle" id="theme-button" title="Toggle brightness">
    <label for="theme">
      <input type="checkbox" id="theme" value="light-theme">
      <span id="dark-theme-button" class="material-symbols-outlined">
        dark_mode
      </span>
      <span id="light-theme-button" class="material-symbols-outlined">
        light_mode
      </span>
    </label>
  </div>
</header>
<main>
<div
    id="dartdoc-main-content"
    class="main-content"
    data-above-sidebar="nim_core_v2&#47;nim_core_v2-library-sidebar.html"
    data-below-sidebar="nim_core_v2&#47;StorageService-class-sidebar.html">
    <div>
<h1><span class="kind-class">StorageService</span> class 
 
</h1></div>

    
<section class="desc markdown">
  <p>存储服务</p>
</section>


    <section>
      <dl class="dl-horizontal">
        

        
        


        
        
  <dt>Annotations</dt>
  <dd>
    <ul class="annotation-list clazz-relationships">
        <li>@HawkEntryPoint()</li>
    </ul>
  </dd>


      </dl>
    </section>

    
  <section class="summary offset-anchor" id="constructors">
    <h2>Constructors</h2>
    <dl class="constructor-summary-list">
        <dt id="StorageService" class="callable">
          <span class="name"><a href="../nim_core_v2/StorageService/StorageService.html">StorageService</a></span><span class="signature">({<span class="parameter" id="-param-instanceId"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/int-class.html">int</a>?</span> <span class="parameter-name">instanceId</span></span>})</span>
        </dt>
        <dd>
          
        </dd>
    </dl>
  </section>
    
  <section
      class="summary offset-anchor"
      id="instance-properties">
    <h2>Properties</h2>
    <dl class="properties">
        <dt id="hashCode" class="property inherited">
  <span class="name"><a href="https://api.flutter.dev/flutter/dart-core/Object/hashCode.html">hashCode</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/int-class.html">int</a></span>
  

</dt>
<dd class="inherited">
  The hash code for this object.
  <div class="features"><span class="feature">no setter</span><span class="feature">inherited</span></div>

</dd>

        <dt id="instanceId" class="property">
  <span class="name"><a href="../nim_core_v2/StorageService/instanceId.html">instanceId</a></span>
  <span class="signature">&#8596; <a href="https://api.flutter.dev/flutter/dart-core/int-class.html">int</a>?</span>
  

</dt>
<dd>
  聊天室Id
  <div class="features"><span class="feature">getter/setter pair</span></div>

</dd>

        <dt id="onFileDownloadProgress" class="property">
  <span class="name"><a href="../nim_core_v2/StorageService/onFileDownloadProgress.html">onFileDownloadProgress</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Stream-class.html">Stream</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMDownloadFileProgress-class.html">NIMDownloadFileProgress</a></span>&gt;</span></span>
  

</dt>
<dd>
  文件下载进度
  <div class="features"><span class="feature">no setter</span></div>

</dd>

        <dt id="onFileUploadProgress" class="property">
  <span class="name"><a href="../nim_core_v2/StorageService/onFileUploadProgress.html">onFileUploadProgress</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Stream-class.html">Stream</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMUploadFileProgress-class.html">NIMUploadFileProgress</a></span>&gt;</span></span>
  

</dt>
<dd>
  文件上传进度
  <div class="features"><span class="feature">no setter</span></div>

</dd>

        <dt id="onMessageAttachmentDownloadProgress" class="property">
  <span class="name"><a href="../nim_core_v2/StorageService/onMessageAttachmentDownloadProgress.html">onMessageAttachmentDownloadProgress</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Stream-class.html">Stream</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMDownloadMessageAttachmentProgress-class.html">NIMDownloadMessageAttachmentProgress</a></span>&gt;</span></span>
  

</dt>
<dd>
  消息附件下载进度
  <div class="features"><span class="feature">no setter</span></div>

</dd>

        <dt id="runtimeType" class="property inherited">
  <span class="name"><a href="https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html">runtimeType</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Type-class.html">Type</a></span>
  

</dt>
<dd class="inherited">
  A representation of the runtime type of the object.
  <div class="features"><span class="feature">no setter</span><span class="feature">inherited</span></div>

</dd>

    </dl>
  </section>

    
  <section
      class="summary offset-anchor"
      id="instance-methods">
    <h2>Methods</h2>
    <dl class="callables">
        <dt id="addCustomStorageScene" class="callable">
  <span class="name"><a href="../nim_core_v2/StorageService/addCustomStorageScene.html">addCustomStorageScene</a></span><span class="signature">(<wbr><span class="parameter" id="addCustomStorageScene-param-sceneName"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span> <span class="parameter-name">sceneName</span>, </span><span class="parameter" id="addCustomStorageScene-param-expireTime"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/int-class.html">int</a></span> <span class="parameter-name">expireTime</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMStorageScene-class.html">NIMStorageScene</a></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  添加自定义存储场景
  

</dd>

        <dt id="cancelUploadFile" class="callable">
  <span class="name"><a href="../nim_core_v2/StorageService/cancelUploadFile.html">cancelUploadFile</a></span><span class="signature">(<wbr><span class="parameter" id="cancelUploadFile-param-fileTask"><span class="type-annotation"><a href="../nim_core_v2/NIMUploadFileTask-class.html">NIMUploadFileTask</a></span> <span class="parameter-name">fileTask</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter">void</span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  取消文件上传
  

</dd>

        <dt id="createUploadFileTask" class="callable">
  <span class="name"><a href="../nim_core_v2/StorageService/createUploadFileTask.html">createUploadFileTask</a></span><span class="signature">(<wbr><span class="parameter" id="createUploadFileTask-param-fileParams"><span class="type-annotation"><a href="../nim_core_v2/NIMUploadFileParams-class.html">NIMUploadFileParams</a></span> <span class="parameter-name">fileParams</span>, {</span><span class="parameter" id="createUploadFileTask-param-fileObj"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-html/File-class.html">File</a>?</span> <span class="parameter-name">fileObj</span></span>})
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMUploadFileTask-class.html">NIMUploadFileTask</a></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  创建文件上传任务
  

</dd>

        <dt id="downloadAttachment" class="callable">
  <span class="name"><a href="../nim_core_v2/StorageService/downloadAttachment.html">downloadAttachment</a></span><span class="signature">(<wbr><span class="parameter" id="downloadAttachment-param-downloadParam"><span class="type-annotation"><a href="../nim_core_v2/NIMDownloadMessageAttachmentParams-class.html">NIMDownloadMessageAttachmentParams</a></span> <span class="parameter-name">downloadParam</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  下载消息附件
  

</dd>

        <dt id="downloadFile" class="callable">
  <span class="name"><a href="../nim_core_v2/StorageService/downloadFile.html">downloadFile</a></span><span class="signature">(<wbr><span class="parameter" id="downloadFile-param-url"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span> <span class="parameter-name">url</span>, </span><span class="parameter" id="downloadFile-param-filePath"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span> <span class="parameter-name">filePath</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  下载文件
  

</dd>

        <dt id="getImageThumbUrl" class="callable">
  <span class="name"><a href="../nim_core_v2/StorageService/getImageThumbUrl.html">getImageThumbUrl</a></span><span class="signature">(<wbr><span class="parameter" id="getImageThumbUrl-param-attachment"><span class="type-annotation"><a href="../nim_core_v2/NIMMessageAttachment-class.html">NIMMessageAttachment</a></span> <span class="parameter-name">attachment</span>, </span><span class="parameter" id="getImageThumbUrl-param-thumbSize"><span class="type-annotation"><a href="../nim_core_v2/NIMSize-class.html">NIMSize</a></span> <span class="parameter-name">thumbSize</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMGetMediaResourceInfoResult-class.html">NIMGetMediaResourceInfoResult</a></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  获取图片消息中的图片缩略图
传入短链自动获取长链地址并携带缩略图相关 URL 查询参数
旧的下载地址会做新的 CDN 加速域名地址替换
开启自定义鉴权会返回对应的鉴权信息
  

</dd>

        <dt id="getStorageSceneList" class="callable">
  <span class="name"><a href="../nim_core_v2/StorageService/getStorageSceneList.html">getStorageSceneList</a></span><span class="signature">(<wbr>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="https://api.flutter.dev/flutter/dart-core/List-class.html">List</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMStorageScene-class.html">NIMStorageScene</a></span>&gt;</span></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  查询存储场景列表
  

</dd>

        <dt id="getVideoCoverUrl" class="callable">
  <span class="name"><a href="../nim_core_v2/StorageService/getVideoCoverUrl.html">getVideoCoverUrl</a></span><span class="signature">(<wbr><span class="parameter" id="getVideoCoverUrl-param-attachment"><span class="type-annotation"><a href="../nim_core_v2/NIMMessageAttachment-class.html">NIMMessageAttachment</a></span> <span class="parameter-name">attachment</span>, </span><span class="parameter" id="getVideoCoverUrl-param-thumbSize"><span class="type-annotation"><a href="../nim_core_v2/NIMSize-class.html">NIMSize</a></span> <span class="parameter-name">thumbSize</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMGetMediaResourceInfoResult-class.html">NIMGetMediaResourceInfoResult</a></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  获取视频消息中的视频封面
传入短链自动获取长链地址并携带视频封面相关 URL 查询参数
旧的下载地址会做新的 CDN 加速域名地址替换
开启自定义鉴权会返回对应的鉴权信息
  

</dd>

        <dt id="noSuchMethod" class="callable inherited">
  <span class="name"><a href="https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html">noSuchMethod</a></span><span class="signature">(<wbr><span class="parameter" id="noSuchMethod-param-invocation"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/Invocation-class.html">Invocation</a></span> <span class="parameter-name">invocation</span></span>)
    <span class="returntype parameter">&#8594; dynamic</span>
  </span>
  

</dt>
<dd class="inherited">
  Invoked when a nonexistent method or property is accessed.
  <div class="features"><span class="feature">inherited</span></div>

</dd>

        <dt id="shortUrlToLong" class="callable">
  <span class="name"><a href="../nim_core_v2/StorageService/shortUrlToLong.html">shortUrlToLong</a></span><span class="signature">(<wbr><span class="parameter" id="shortUrlToLong-param-url"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span> <span class="parameter-name">url</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  短连接转长连接
  

</dd>

        <dt id="toString" class="callable inherited">
  <span class="name"><a href="https://api.flutter.dev/flutter/dart-core/Object/toString.html">toString</a></span><span class="signature">(<wbr>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span>
  </span>
  

</dt>
<dd class="inherited">
  A string representation of this object.
  <div class="features"><span class="feature">inherited</span></div>

</dd>

        <dt id="uploadFile" class="callable">
  <span class="name"><a href="../nim_core_v2/StorageService/uploadFile.html">uploadFile</a></span><span class="signature">(<wbr><span class="parameter" id="uploadFile-param-fileTask"><span class="type-annotation"><a href="../nim_core_v2/NIMUploadFileTask-class.html">NIMUploadFileTask</a></span> <span class="parameter-name">fileTask</span>, {</span><span class="parameter" id="uploadFile-param-fileObj"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-html/File-class.html">File</a>?</span> <span class="parameter-name">fileObj</span></span>})
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  文件上传
  

</dd>

    </dl>
  </section>
    
  <section
      class="summary offset-anchor inherited"
      id="operators">
    <h2>Operators</h2>
    <dl class="callables">
        <dt id="operator ==" class="callable inherited">
  <span class="name"><a href="https://api.flutter.dev/flutter/dart-core/Object/operator_equals.html">operator ==</a></span><span class="signature">(<wbr><span class="parameter" id="==-param-other"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/Object-class.html">Object</a></span> <span class="parameter-name">other</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/bool-class.html">bool</a></span>
  </span>
  

</dt>
<dd class="inherited">
  The equality operator.
  <div class="features"><span class="feature">inherited</span></div>

</dd>

    </dl>
  </section>
    
    
    

  </div> <!-- /.main-content -->
  <div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
    <!-- The search input and breadcrumbs below are only responsively visible at low resolutions. -->
<header id="header-search-sidebar" class="hidden-l">
  <form class="search-sidebar" role="search">
    <input type="text" id="search-sidebar" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
</header>
<ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
    <li><a href="../index.html">nim_core_v2</a></li>
    <li><a href="../nim_core_v2/nim_core_v2-library.html">nim_core_v2</a></li>
    <li class="self-crumb">StorageService class</li>
</ol>

    <h5>nim_core_v2 library</h5>
    <div id="dartdoc-sidebar-left-content"></div>
  </div>
  <div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
  </div><!--/.sidebar-offcanvas-->
</main>
<footer>
  <span class="no-break">
    nim_core_v2
      10.9.2-ohos-beta
  </span>
  
</footer>


<script src="../static-assets/highlight.pack.js?v1"></script>
<script src="../static-assets/docs.dart.js"></script>

</body>
</html>

